package com.sh.apiclientsdk.client;

import cn.hutool.http.HttpRequest;
import cn.hutool.json.JSONUtil;

public class RandomTxtClient extends CommonApiClient  {
    public RandomTxtClient(String accessKey, String secretKey) {
        super(accessKey, secretKey);

    }

    /**
     * 获取随机数
     * @return
     */
    public String getTxt(){
        String json = JSONUtil.toJsonStr("");
        return HttpRequest.get(GATEWAY_HOST+"/interface/random/txt")
                .addHeaders(getHeadMap(json,accessKey,secretKey))
                .body(json)
                .execute().body();
    }

    /**
     * 获取随机数
     * @return
     */
    public String getTest(){
        String json = JSONUtil.toJsonStr("");
        return HttpRequest.get(GATEWAY_HOST+"/interface/random/test")
                .addHeaders(getHeadMap(json,accessKey,secretKey))
                .body(json)
                .execute().body();
    }

}
